Don't crash if we attempt -T input on a format that doesn't support it.
authorrobertl <robertl>
Tue, 17 Oct 2006 15:36:08 +0000 (15:36 +0000)
committerrobertl <robertl>
Tue, 17 Oct 2006 15:36:08 +0000 (15:36 +0000)
main.c

diff --git a/main.c b/main.c
index 59ff76ff91e2e7a8d0dd548fa221dcfe170b9146..b2e36f8bfc0bc3e6aea100b079fd99c9dcbdfbfb 100644 (file)
--- a/main.c
+++ b/main.c
@@ -440,7 +440,15 @@ main(int argc, char *argv[])
         */
        if (global_opts.masked_objective & POSNDATAMASK) {
                waypoint *wpt = waypt_new();
-               ivecs->position_ops.rd_init(fname);
+
+               if (!ivecs->position_ops.rd_position) {
+                       fatal("Realtime tracking (-T) is not suppored by this input type.\n");
+               }
+
+
+               if (ivecs->position_ops.rd_init) {
+                       ivecs->position_ops.rd_init(fname);
+               }
 
                if (global_opts.masked_objective & ~POSNDATAMASK) {
                        fatal("Realtime tracking (-T) is exclusive of other modes.\n");